FROM openjdk:11
# FROM java:8-alpine
ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories
RUN apk add --update curl && rm -rf /var/cache/apk/*
ARG JAR_FILE=target/*.jar
COPY ${JAR_FILE} app.jar
ENV ENV_YML=""
ENV ENV_DISCOVERY=""
ENV ENV_CONFIG=""
EXPOSE 9494
ENTRYPOINT ["java", "-jar", "-Dspring.profiles.active=${ENV_YML}", "-Dspring.cloud.nacos.discovery.namespace=${ENV_DISCOVERY}","-Dspring.cloud.nacos.config.namespace=${ENV_CONFIG}","/app.jar"]